G'Day Forum...I'm trying to get my hands on a trace and impact analysis DXL script that only considers those links that have been created internally to a module. I don't want to see where traces have been established external to a module / between modules. Does anyone have a DXL that does this or know what the script should look like? |
Re: Trace / Impact DXL for Internal Links Only
2 options I can think of for you to consider - both focus on finding the source of an outgoing link where the target of the link is internal to the current module.
Module m = current
Object sourceObj, targetObj
Link l
string internalLinkModName = "<enter full path and name of link module here>"
for sourceObj in m do { //for all visible objects (display set) in the current module
for l in all (sourceObj->internalLinkModName) do { //for all out going links that go through a specific link module
targetObj = target l
print "Source of Internal Link: " identifier(sourceObj) "\tGoes to Target: " identifier (targetObj)"\n"
}
}
Module m = current
Object sourceObj, targetObj
Link l
string internalLinkModName = "*" //wildcard for all link modules
ModuleVersion targetModVersion = null
ModuleVersion sourceModVersion = null
for sourceObj in m do { //for all visible objects (display set) in the current module
for l in all (sourceObj->internalLinkModName) do { //for all out going links
targetModVersion = targetVersion l
sourceModVersion = sourceVersion l
if (sourceModVersion == targetModVersion) { //if the target module is the same as the source then it must be internal
targetObj = target l
print "Source of Internal Link: " identifier(sourceObj) "\tGoes to Target: " identifier (targetObj)"\n"
}
}
}
Paul Miller
|
Re: Trace / Impact DXL for Internal Links Only eg for out links: // prevent dxl timeout dialog pragma runLim, 0 // includes #include <c:/Program Files/Telelogic/DOORS_8.3/lib/dxl/layout/actual/common.inc> // constants const string S_LINK_MODULE = "*" const string S_INITIAL_INDENT = "" const string S_LEVEL_INDENT = " " // constants const int I_MAX_DEPTH = 0 // globals Skip g_skpLinkedObjects = create void fnRecursiveOutlink(Object o, int iDepth, string sIndent) { // only relevant if object has not been handled if (find(g_skpLinkedObjects, o) == false) { Link l put(g_skpLinkedObjects, o, o) // process out-links int iSavedDepth = iDepth for l in all(o -> S_LINK_MODULE) do { ModuleVersion targetVer = targetVersion(l) ModuleVersion sourceVer = sourceVersion(l) if (sourceVer == targetVer) { // only relevant if module exists with r access if (exists(module targetVer)) { // ensure module is open if (null data(targetVer)) { Module m = load(targetVer, false) if (m != null && g_skpLayoutDXLOutLinkModulesOpened != null) { // add to skip put(g_skpLayoutDXLOutLinkModulesOpened, m, m) } } Object oTarget = target l // check status if (oTarget != null) { displayRich sIndent "-> {\\b " baselineName(targetVer) ":} Object " identifier(oTarget) " (through {\\i " fullName(module l) "})" // check status if (I_MAX_DEPTH == 0 || --iDepth > 0) { // call recursively fnRecursiveOutlink(oTarget, iDepth, sIndent S_LEVEL_INDENT) } } } iDepth = iSavedDepth } } delete(g_skpLinkedObjects, o) } } // process out-links { fnRecursiveOutlink(obj, I_MAX_DEPTH, S_INITIAL_INDENT) if (isLastObjectInDXLSet(obj)){ // Need to keep skip list of open modules a la suspect links? // Need to close them all once we're done. fnCloseModules(g_skpLayoutDXLOutLinkModulesOpened) } // delete skip delete g_skpLinkedObjects } |